package me.keiwu.user.domain;

import lombok.Data;
import org.hibernate.annotations.ColumnDefault;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by kei on 06/11/2017.
 */
@Entity
@Data
@Table(indexes = {
        @Index(name = "idx_uid", columnList = "userId"),
        @Index(name = "idx_days", columnList = "days"),
})
public class UserStep {

    @Id
    @GeneratedValue
    private Long id;

    private Long userId;

    @ColumnDefault("0")
    @Column(nullable = false)
    private Integer step = 0;

    @ColumnDefault("0")
    @Column(nullable = false)
    private Integer exchangedStep = 0;

    private Integer timestamp;

    // 从公元元年开始
    private Integer days;

}
